#pragma once
#include <iostream>
#include <string>
#include <vector>

namespace cloud
{
    class Request
    {
    public:
        Request(){}
        ~Request(){}

        void print()
        {
            std::cout << "method: " << _method;
            std::cout << " url: " << _url;
            std::cout << " version: " << _version << std::endl;
            std::cout << "heads:" << std::endl;
            for(auto &it : _heads)
            {
                std::cout << "    " << it << std::endl;
            }
            //std::cout << "content: " << _content << std::endl;
            //std::cout << "content大小: " << _content.size() << std::endl;
        }
    public:
        std::string _method;
        std::string _url;
        std::string _version;
        std::vector<std::string> _heads;//报头属性字段
        std::string _content;

        // 单独拎出来的报头属性字段
        size_t _content_len = 0;
        std::string _boundary; // 多个表单上传的数据的分隔符，没用到
    };

    class Response
    {
    public:
        Response(){}
        ~Response(){}

        void print()
        {
            std::cout << "version: " << _version << std::endl;
            std::cout << "status: " << _status << std::endl;
            std::cout << "info: " << _info << std::endl;
            std::cout << "heads:" << std::endl;
            for(auto &it : _heads)
            {
                std::cout << "    " << it << std::endl;
            }
            std::cout << "content: " << _content << std::endl;
        }
    public:
        std::string _version = "HTTP/1.1";
        std::string _status = "200";
        std::string _info = "OK";
        std::vector<std::string> _heads;//报头属性字段
        std::string _content;

        std::string _content_len;
    };
}